package com.bcbim.authentication.menu.mapper;

import com.bcbim.authentication_interface.ability.dao.RoleAbilityDAO;
import com.bcbim.authentication_interface.role.dto.RoleMenuAbilityDTO;
import com.bcbim.authentication_interface.role.vo.MenuAbilityVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @Description: 功能表
 * @Author: ye
 * @Date: 2021/7/7
 * @Version: V1.0
 **/
@Mapper
public interface AbilityMapper {

    /**
     * @Description: 获取所有功能
     * @Param: applicationPlatform
     * @Return: List<MenuAbilityVO>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<MenuAbilityVO> getAllAbilityByApplication(String applicationPlatform);

    /**
     * @Description: 获取角色拥有功能权限
     * @Param: RoleMenuAbilityQuery
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> getRoleAbilityAuthentication(RoleMenuAbilityDTO query);

    /**
     * @Description: 根据页面id获取功能
     * @Param: List<String> 页面id
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> getAbilityByMenuId(@Param("list") List<String> childrenPage);

    /**
     * @Description: 清除角色功能权限
     * @Param: roleId
     * @Param: arrayAbilityId
     * @Return:
     * @Author: ye
     * @Date: 2021/7/7
     */
    void clearRoleAuthentication(@Param("roleId") String roleId, @Param("list") List<String> arrayAbilityId);

    /**
     * @Description: 区分功能
     * @Param: String[] checkId
     * @Return: List<String>
     * @Author: ye
     * @Date: 2021/7/7
     */
    List<String> distinguishAbility(@Param("list") String[] checkId);

    /**
     * @Description: 保存角色权限
     * @Param: List<RoleAbilityDO>
     * @Return:
     * @Author: ye
     * @Date: 2021/7/7
     */
    void saveRoleAuthentication(@Param("list") List<RoleAbilityDAO> roleAbilityList);
}
